OSX append search domain

It seems in OSX the search domain will not be appended to hostnames that contain two or more labels separated by dots. For example pinging the the following does not work

To solve this, do the following below:

  1. In Yosemite (10.10.5) add the "hamwan.net" & "hamwan.org" to the search domains in the GUI
  2. sudo vi /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
  3. Then find the line:
<dict>
     <array>
          <string>/usr/sbin/mDNSResponder</string>
     </array>
  1. ADD:
<dict>
     <array>
          <string>/usr/sbin/mDNSResponder</string>
          <string>-AlwaysAppendSearchDomains</string>
     </array>
  1. sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
  2. sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
  3. Make sure you DNS cache is clean (one of the following should work)
    • sudo killall -HUP mDNSResponder
    • sudo discoveryutil mdnsflushcache
    • sudo dscacheutil -flushcache
  4. Test:
    • ping snodem.etiger

Referenced from: http://apple.stackexchange.com/questions/140160/alternative-to-alwaysappendsearchdomains-on-yosemite